# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>

pkgname=libxcb
pkgver=1.13.1
pkgrel=1
pkgdesc="X11 client-side library"
arch=('x86_64')
url="https://xcb.freedesktop.org/"
depends=('xcb-proto>=1.12' 'libxdmcp' 'libxau')
makedepends=('libxslt' 'python' 'xorg-util-macros')
license=('custom')
source=($url/dist/$pkgname-$pkgver.tar.bz2 #{,.sig}
        libxcb-1.1-no-pthread-stubs.patch)
sha256sums=('a89fb7af7a11f43d2ce84a844a4b38df688c092bf4b67683aef179cdf2a647c4'
            '21bf86a40e4038c52c2a8c57f76b5f10e211e27562cce7526b4bb6fd025dd0c3')
#validpgpkeys=('A66D805F7C9329B4C5D82767CCC4F07FAC641EFF') # "Daniel Stone <daniels@collabora.com>"

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i ../libxcb-1.1-no-pthread-stubs.patch
  autoreconf -vfi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr \
    --enable-xinput \
    --enable-xkb \
    --disable-static
  make -j1
}

check() {
  cd $pkgname-$pkgver
  make -k check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  install -m755 -d "$pkgdir/usr/share/licenses/$pkgname"
  install -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname"
}
